home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11275 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.8 KB  |  80 lines

  1. Path: rover.ucs.ualberta.ca!nbehzad
  2. From: nbehzad@ee.ualberta.ca (Nader Behzad)
  3. Newsgroups: comp.lang.c
  4. Subject: Floating exception
  5. Date: 22 Mar 1996 22:39:07 GMT
  6. Organization: University of Alberta Electrical Engineering Department
  7. Message-ID: <4iva6b$153m@pulp.ucs.ualberta.ca>
  8. NNTP-Posting-Host: nyquist.ee.ualberta.ca
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. Hi all,
  12.  
  13.  
  14. I just upgraded my gcc to version 2.7.2. My code was working fine
  15. under gcc2.6.0.  Now I get a Floating exception that I can not figure
  16. out where is comming from. When I run the code through gdb it runs 
  17. fine!! Also when I put a print statement in the main loop (just a
  18. useless print statement, The code runs fine. In fact the results are
  19. the same as the code compiled with the older gcc. 
  20.     if(!shut_up)fprintf(stdout,"...\n");
  21. But without this my code crashes and I get a floating point exception.
  22. By the way I am compiling this code on DEC (64bit architecture) and
  23. this is the first time that we have ported our code to this machine!!
  24. Our developing platform is SUN.
  25.  
  26. This is where my code is acting strange:
  27.  
  28. main.c:
  29. void main(int argc, char *argv[])
  30. {
  31. ...
  32.     logical intmd1,intmd2,anealF,udist,altdisc,random;
  33. ...
  34.     parse(&stoptime,&stopthick,&mode,&prstep,&intmd1,&intmd2,&anealF,
  35.       &udist,&altdisc,TRUE,1);
  36. ...
  37. }
  38. udist is assigned a value in the routine:
  39. parse.c:
  40. void parse(int *stoptime_p,
  41.            real *stopthick_p,
  42.            char *mode_p,
  43.            int *prstep_p,
  44.            logical *intmd1_p,
  45.            logical *intmd2_p,
  46.            logical *anealF_p,
  47.            logical *udist_p,
  48.            logical *altdisc_p,
  49.        logical first,
  50.        int curr_layer)
  51. {
  52. ...
  53.     *udist_p = v_p->value.c == 'T' ? True : False;
  54. ...
  55. }
  56.  
  57. udist is correctly gets assigned a value, but when I look
  58. at the udist value after the parse function call it is 1023 ??
  59.  
  60. I dont know whether this has anything to do with the floating exception
  61. errors?? If you have any suggestions as where I can start looking to 
  62. solve this problem, I would appreciate it.
  63.  
  64. Thank you in Advance,
  65. Sincerely,
  66. Nader
  67. ---
  68. ---------------------------------------------------------------------
  69. |                                                                   | 
  70. | Nader T. Behzad                                                   |
  71. | e-mail: nbehzad@ee.ualberta.ca                                    |
  72. | WWW: http://www.ee.ualberta.ca/~nbehzad                           |
  73. |                                                                   |
  74. |===================================================================|
  75. |                                                                   |
  76. | "Whatever you do will be insignificant, but it is very            |
  77. |  important that you do it." --Mahatma Gandhi                      |
  78. |                                                                   |
  79. ---------------------------------------------------------------------
  80.